package fr.univ.lr.icone.gui.event;

import java.awt.Point;

/**
 * A class that implements an Event structure
 * 
 * @author Elian ORIOU
 * 
 */

public class Event implements IEvent {

	private int agentID;
	private EventType type;
	private int opinion;
	private int confiance;
	private Point position;
	private Point oldPosition;

	public Event() {
		this(0, EventType.NONE, 0, 1, null, null);
	}

	public Event(int agendID, EventType type) {
		this(agendID, type, 0, 1, null, null);
	}

	public Event(int agentID, EventType type, int opinion) {
		this(agentID, type, opinion, 1, null, null);
	}

	public Event(int agentID, EventType type, int opinion, int confiance) {
		this(agentID, type, opinion, confiance, null, null);
	}

	public Event(int agentID, EventType type, Point position) {
		this(agentID, type, 0, 1, position, null);
	}

	public Event(int agentID, EventType type, int opinion,
			Point position) {
		this.agentID = agentID;
		this.type = type;
		this.opinion = opinion;
		this.confiance = 1;
		this.position = position;
		this.oldPosition = null;
	}
	
	public Event(int agentID, EventType type, int opinion,
			Point position, Point oldPosition) {
		this.agentID = agentID;
		this.type = type;
		this.opinion = opinion;
		this.confiance = 1;
		this.position = position;
		this.oldPosition = oldPosition;
	}

	public Event(int agentID, EventType type, int opinion, int confiance,
			Point position, Point oldPosition) {
		this.agentID = agentID;
		this.type = type;
		this.opinion = opinion;
		this.confiance = confiance;
		this.position = position;
		this.oldPosition = oldPosition;
	}
	
	@Override
	public int getAgentID() {
		return agentID;
	}

	@Override
	public EventType getEventType() {
		return type;
	}

	@Override
	public int getOpinion() {
		return opinion;
	}

	@Override
	public Point getPosition() {
		return position;
	}

	@Override
	public Point getOldPosition() {
		return oldPosition;
	}

	@Override
	public String toString() {
		return "Event [agentID=" + agentID + ", confiance=" + confiance
				+ ", oldPosition=" + oldPosition + ", opinion=" + opinion
				+ ", position=" + position + ", type=" + type + "]";
	}

	@Override
	public int getConfiance() {
		return this.confiance;
	}
}
